/**
 * @description 深拷贝
 * @param {*} obj: Array | Object
 */
export let clone = function (obj) {
  let objClone = Array.isArray(obj) ? [] : {};
  if (obj && typeof obj === 'object') {
    for (let key in obj) {
      if (obj.hasOwnProperty(key)) {
        if (obj[key] && typeof obj[key] === 'object') {
          objClone[key] = clone(obj[key]);
        } else {
          objClone[key] = obj[key];
        }
      }
    }
  }
  return objClone;
};
/**
 * 判断对象类型
 * @param value
 * @returns {Function | Object | Array | String | RegExp | Number | Undefined | Null}
 */
export function typeOf (value) {
  const typeStr = Object.prototype.toString.call(value);

  return typeStr.substring(8, typeStr.length - 1);
}